function zz = zz_wlc(f)

%    inverse function of "ff_wlc(zz)"

    a = 3.*(135-108.*f+144.*f.*f-64.*f.*f.*f);
    
    if(a>0)
        b = (243-108.*f+144.*f.*f-64.*f.*f.*f+12.*sqrt(a)).^(1./3.0);
        zz = (9+4.*f)./12.0 + (-9+24.*f-16.*f.*f)./(12.0.*b) - b./12.0;
    else
        im = 12.*sqrt(-a);        %+ or -, now +.
        re = 243-108.*f+144.*f.*f-64.*f.*f.*f;
        r = sqrt(im.*im + re.*re);
        theta = acos(re./r);
        r = r.^(1./3.0);
        theta = theta./3.0;
        im = r.*sin(theta);
        re = r.*cos(theta);

        im = (-9+24.*f-16.*f.*f).*(-im)./(12.0.*r.*r) - im./12.0;        % test: im should be zero.
        zz = (9+4.*f)./12.0 + (-9+24.*f-16.*f.*f).*re./(12.0.*r.*r) - re./12.0;
    end